<template>
  <div>
    <el-button size="medium" @click="addproduct" type="primary" style="margin-left: 16px;">
      添加商品
    </el-button>
    <el-button size="medium" @click="eidtproduct" type="primary" style="margin-left: 16px;">
      编辑商品
    </el-button>
    <el-dialog title="编辑商品" :visible.sync="drawer" destroy-on-close width="80%">

      <editproduct @on-close="beClose" :Pid='prouduct_id' :Producttype="Producttype"></editproduct>
      </el-dialog>
  </div>


</template>

<script>
  import Editproduct from './components/Editproduct'
  import {fitter_keyword}  from "@/utils/index"

  export default {
    data() {
      return {
        Producttype: 'add',
        drawer: false,
        direction: 'rtl',
        prouduct_id: '123456'
      }
    },
    components: {
      Editproduct
    },
    methods: {
      handleClose(done) {
        this.$confirm('确认关闭？')
          .then(_ => {
            done();
          })
          .catch(_ => {});
      },
      addproduct() {
        this.Producttype = 'add';
        this.drawer = true
      },
      eidtproduct() {
        this.Producttype = 'edit'
        this.drawer = true
      },
      beClose() {
        this.drawer = false
      },
    }
  }
</script>

<style>

</style>
